<form class="form-page needs-validation">
    <div class="params">
        <p class="alert alert-warning">垃圾回收是一个计算密集型操作，可能会影响仓库性能</p>
        <section class="section basic">
            <fieldset>
                <div class="part collapse show">
                    <div class="item">
                        <div class="control-label">
                            <span class="key">当前定时任务</span>
                        </div>
                        <div class="controls">
                            <div class="select-con width-200">
                                <select class="form-control" v-model="policy">
                                    <option value="None">无</option>
                                    <option value="Hourly">每小时（0 0 * * * *）</option>
                                    <option value="Daily">每天（0 0 0 * * *）</option>
                                    <option value="Weekly">每周（0 0 0 * * 0）</option>
                                    <option value="Custom">自定义</option>
                                </select>
                            </div>
                            <input class="form-control width-200 mt-2" placeholder="- - - - - -" v-model="cron" v-if="policy == 'Custom'" />
                            <span class="help">定时任务采用 crontab，如需自定义时间请确保输入正确 cron 格式</span>
                        </div>
                    </div>
                    <div class="item">
                        <div class="control-label">
                            <span class="key">回收 artifacts</span>
                        </div>
                        <div class="controls">
                            <b-form-checkbox v-model="delete_untagged" name="check-button" switch>
                                <span v-if="delete_untagged">是</span>
                                <span v-else>否</span>
                            </b-form-checkbox>
                            <span class="help">是否允许回收无 Tag 的 Artifacts</span>
                        </div>
                    </div>
                </div>
            </fieldset>
        </section>
    </div>
    <div class="actions">
        <input type="button" value="保存" class="mr-2 btn btn-dark" @click="submit" :disabled="loading" />
        <input type="button" value="立即清理垃圾" class="mr-2 btn btn-primary" @click="clear" :disabled="loading" />
        <input type="button" value="模拟运行" class="mr-2 btn btn-outline-dark" @click="dry" :disabled="loading" />
    </div>
</form>
